﻿'Option Strict Off
Option Explicit On
Imports System

Imports System.Data.Common
Imports System.Data.SqlClient

Namespace MasschangeDSTableAdapters
    Partial Public Class BudgetDetailsTableAdapter
        Inherits System.ComponentModel.Component
        Public Function CreateTransaction() As System.Data.SqlClient.SqlTransaction
            Dim oConnection = Me.CommandCollection(0).Connection
            oConnection.Open()

            Dim oTrans = oConnection.BeginTransaction()

            SetTransaction(oTrans)

            Return oTrans
        End Function


        Public Sub SetTransaction(ByVal oTrans As System.Data.SqlClient.SqlTransaction)
            For Each cmd In Me.CommandCollection
                cmd.Connection = oTrans.Connection
                cmd.Transaction = oTrans
            Next
        End Sub

        Public Sub SetCommandTimeOut(ByVal timeOut As Integer)
            For Each command As SqlCommand In Me.CommandCollection
                command.CommandTimeout = timeOut
            Next
        End Sub

    End Class
End Namespace